#include <iostream>
#include <vector>

using namespace std;

static vector<pair<uint64_t, uint64_t>> prime_factorization(uint64_t n) {
    vector<pair<uint64_t, uint64_t>> v;
    for (uint64_t i = 2; i * i <= n; ++i) {
        uint64_t c = 0;
        while (n % i == 0) {
            n /= i;
            ++c;
        }
        if (c > 0)
            v.push_back({i, c});
    }
    if (n > 1)
        v.push_back({n, 1});
    return v;
}

int main() {
    constexpr auto lim = static_cast<uint64_t>(1e7);
    uint64_t ans = 0;
    uint64_t count = 2;
    for (uint64_t i = 3; i < lim; ++i) {
        auto v = prime_factorization(i);
        uint64_t c = 1;
        for (auto& p : v)
            c *= (p.second + 1);
        if (c == count) 
            ++ans;
        count = c;
    }
    cout << ans << endl;
}   // 986262